<?php

include ("include/config.php");

stemplate::assign("main_categories", core_categories());
require($config['basedir']."/classes/category.class.php");
$post = $_REQUEST;
$obj_cat = new Category();

$_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';

switch($_action) {

	case 'updateCart':
		$obj_cat->updateCart($post); 
	break;
	
	case 'removeProductFromCart':
		$obj_cat->removeProductFromCart($post); 
	break;
	
	case 'order_form':
		stemplate::assign("post", $post);
 		stemplate::display("order_page.tpl");
	break;
	
	case 'saveOrder':
 		$obj_cat->saveOrder($post); 
 	break;
	
	case 'view':
	default:
		$cart_contents = $obj_cat->getCartContents($post); 
  		stemplate::assign("cart_contents", $cart_contents);
   		stemplate::assign("_page_title", "Shoping Cart");
 		stemplate::display("cart.tpl");
    break; 

}




?>